//
//  GifImageView.m
//  GIf测试
//
//  Created by 王旭阳 on 2017/4/12.
//  Copyright © 2017年 王旭阳. All rights reserved.
//

#import "GifImageView.h"
#import "HKCommonDefine.h"
#import "UIView+properties.h"

@interface GifImageView ()

@property (nonatomic, strong) UIActivityIndicatorView *indicatorView;
@end

@implementation GifImageView
- (id)initWithFrame:(CGRect)frame
          TishiText:(NSString *)tishiStr {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor=[UIColor whiteColor];
        int webWidth= HKScreenWidth /5.357143;
        
        self.indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
        self.indicatorView.frame = CGRectMake(HKScreenWidth/2-(webWidth/2), 230, HKScreenWidth/5.357143, HKScreenWidth/5.357143);
        [self addSubview:self.indicatorView];
        [self.indicatorView startAnimating];

        UILabel*lab=[[UILabel alloc]initWithFrame:CGRectMake(HKScreenWidth/2-40, self.indicatorView.top+self.indicatorView.height-5,80 , 15)];
        lab.textAlignment = NSTextAlignmentCenter;
        lab.text=tishiStr;
        lab.textColor=COLOR(188, 188, 188, 1);
        lab.font=[UIFont systemFontOfSize:12];
        [self addSubview:lab];
    }
    return self;
}

- (void)removeSelf {
    [self.indicatorView stopAnimating];
    [self removeFromSuperview];
}

@end
